#pragma once
#include "cybertron/DefinesCore.hpp"
#include <atomic>
#include <string>
#include "cybertron/node/NodeHotAreaManager.hpp"
#include "cybertron/sensor/noise/IMUNoiseMaker.hpp"
#include "TaskHotAreaBase.hpp"
#include "SimOneIOStruct.h"
using namespace cybertron;

class CTaskGps:public CTaskHotAreaBase
{
public:

	CTaskGps();
	virtual ~CTaskGps();
	virtual void HotAreaEnter() ;
	virtual void HotAreaLeft(int frame, int ms, int msModNs, TrafficActorHotArea* pHotArea);
	virtual void ActorToDo(int hostVehicleId, int frame, int ms, int msModNs, TrafficActorHotArea* pHotArea, TrafficActor* pActor, int index) override;
	virtual char* GetResult(std::string hostVehicleId) override;
	virtual int GetHotAreaDataLength(std::string hostVehicleId) override;
	virtual void Clear() override;
	virtual EIOTaskType GetTaskType()  { return TaskTypeGPS; }
protected:
	SimOne_Data_Gps mLastGpsInfo;
	//IMUNoiseMakerPtr mIMUNoiseMaker;
	typedef map<std::string, IMUNoiseMakerPtr> IMUNoiseMakerMap;
	IMUNoiseMakerMap mIMUNoiseMakerMap;
	float			mOdometer;
	cybertron::vec3	mLastPos; // pos without noise

	typedef map<std::string, SimOne_Data_Gps> SimOne_Data_GpsMap;
	SimOne_Data_GpsMap mLastGPSDataMap;
};